<template>
	<div id="actives">
		<div class="fixed">
			<div class="title flex">
				<div class="title_left">
					<img @click="back" src="../assets/image/return.png" />
				</div>
				<div class="add">
					查看详情
				</div>
				<div class="title_right">
					
				</div>
			</div>

		</div>
		<div class="lists">
             <div class="active_detail">
             	
			   
			   	<div >
			   	活动名称：<span>{{active_name}}</span>
			   </div>
			    <div >
			   	活动周期：<span >{{active_start_time}}至{{active_end_time}}</span>
			   </div>
			    <div >
			        参与店铺：<span>{{num_ct}}名</span>
			   </div>
			   <div >
			        已报名：<span>{{num_bm}}名</span>
			   </div>
			   <p>要求说明</p>
			   <div class="shiyong_detail">
			   	{{active_require}}
			   </div>
			 
             </div>
             <div class="fen flex">
             	<img src="../assets/image/baominghuodong.png"/>
             </div>
             
			<div class="list flex"  >

				<div class="qian" v-if="active.coupons_type==1">
					<div>{{active.coupons_money}}</div>
					<img style="width: 0.4217rem;height: 0.5217rem;" src="../assets/image/qian.png" />
				
				</div>
				<div class="qian" v-if="active.coupons_type==2">
				<div>{{active.coupons_discount}}</div>
					
				
				
					<img style="width: 0.565217rem;height: 0.8043rem;" src="../assets/image/zhe.png"/>
				</div>
				<div class="xian">
					<img src="../assets/image/fengexain.png" />
				</div>
				<div class="right flex">
					<div v-if="active.coupons_type==1">满{{active.full_money}}享满减</div>
					<div v-if="active.coupons_type==2">满{{active.full_money}}享折扣</div>
					
					<div class="data">
						<span>有效期：</span><span>{{active_start_time}}至{{active_end_time}}</span>
					</div>
				</div>

			</div>
			
			<div class="detail">
			   <p>使用说明:</p>
			   <div v-if="active.use_desc" class="shiyong_detail">
			   	{{active.use_desc}}
			   </div>
			    <div v-else class="shiyong_detail">
			   	暂无使用说明~
			   </div>
			   <div class="con">
			   	<div class="shopname">
			   	店铺：<span>{{store.store_name}}</span>
			   </div>
			    <div class="phone">
			   	联系电话：<span style="color: #007AFF;">{{store.store_phone}}</span>
			   </div>
			    <div class="address">
			   地址：<span>{{store.store_address}}</span><img src="../assets/image/dingwei.png"/>
			   </div>
			   </div>
			   
			</div>

		</div>
		
	</div>



</template>

<script>
	export default {
		data() {
			return {
				isActive: 0,
				show: -1,
				activeIndex: -1,
				active_id:this.$route.query.active_id,
               coupon_id:this.$route.query.coupon_id,
               	active_start_time:"",
               	active_end_time: "",
               	num_ct:"",
               	num_bm:"",
               	active_name:"",
               	active_require:"",
               	store:[{
               		store_address:"",
               		store_name:"",
               		store_phone:""
               	}],
              
               	active:{
               		coupons_money:"",
               		coupons_discount:"",
               		coupons_type:"",
               		full_money:"",
               		use_desc:"",
               		coupons_end_time:"",
               		coupons_start_time:"",
               	},
               	
              
			}
		},
		//在模板渲染成html前调用，即通常初始化某些属性值，然后再渲染成视图
		created: function() {
           this.list()
		},
		methods: {
			back() {
				this.$router.go(-1)
			},
			showop(index) {
				let that = this;
				if(that.show == index) {
					that.show = -1; //在这里就将它赋值为-1  由于：-1 !=  index 所以其他内容隐藏 ，被点击的则打开
				} else {
					that.show = index; //这里是把index赋值给isShow，isShow=index则显示
				}

			},
			//查看详情
			creat_c() {
				this.$router.push({
					path: '/Create_coupons'
				});
			},
			showtost() {
				$(".mask").css('display', 'block');

			},
			yincang() {
				$(".mask").css('display', 'none');
			},
			  list(){
           	var that=this;
           var qs = require('qs');
			that.$http.post(this.baseURL+"/index.php/waveguest/coupon/my_list_detaile", qs.stringify({
						"active_id": that.active_id,
						"coupon_id":that.coupon_id,
						"store_id":localStorage.getItem("store_id"),
						"key":localStorage.getItem("key")
				})).then(response => {
					
					that.active=response.data.data.active
					console.log(that.active)
					that.active_start_time=response.data.data.active_start_time  
               	that.active_end_time=response.data.data.active_end_time
               	that.num_bm=response.data.data.num_bm
               	that.num_ct=response.data.data.num_ct
               	that.active_require=response.data.data.active_require
           
           	that.active_name=response.data.data.active_name
               	that.store=response.data.data.store
					})
					.catch(error => {

					});
    
          },
          
		},
		mounted() {
 

		},
	}
</script>

<style>
.el-message {
    min-width: 4rem;
    top: 40% !important;
}
</style>
<style scoped="scoped">
	#actives {
	background:#F5F6FA;
		padding-bottom: 2rem;
	}
		
	.title {
		width: 90%;
		padding: 0 5% 0 5%;
		height: 2rem;
		font-size: 0.7193rem;
		background: white;
		align-items: center;
	}
	
	.title div {
		width: calc(100%/3);
		align-items: center;
	}
	
	.title>div:nth-child(2) {
		text-align: center;
	}
	
	
	
	.title_left {
		width: 0.67391rem;
		height: 0.67391rem;
	}
	
	.title_left>img {
		width: 0.67391rem;
		height: 0.67391rem;
	}
	
	.title_right {
		width: 0.9rem;
		height: 0.9rem;
	}
	
	.title_right>img {
		width: 0.9565rem;
		height: 0.9365rem;
		float: right;
	}
	
	.lists {
		margin-top: 2rem;
		padding-top: 1rem;
		
	}
	
	.list {
		/*border: 1px solid white;*/
		margin-bottom: 0.5rem;
		margin-left: 0.5rem;
		margin-right: 0.5rem;
		padding-right: 1rem;
		padding-left: 1rem;
		background: url(../assets/image/quan_bg.png) no-repeat;
		background-size: 100%;
		border-radius: 10px;
		height: 5.8478rem;
		justify-content: space-between;
		align-items: center;
		
	}
	.fixed {
		position: fixed;
		top: 0;
		background: white;
		width: 100%;
		max-width: 640px;
		
	}
   .list>.qian{
   	font-size: 2.57826rem;
   	color: white;
   	position: relative;
   }
    .list>.qian>img{
   	
   	position: absolute;
   	right: -0.5rem;
   	top: 0;
   }
   .list>.right{
   	font-size: 1.3043rem;
   	color: white;
   flex-direction: column;
   }
   .list>.xian>img{
   width: 0.07rem;
   height: 1.7391rem;	
   }
   .list>.right>.data{
   	padding-top: 0.5rem;
   	font-size: 0.5rem;
   	color: white;
  
   }
.detail{
	background: white;
	margin-bottom: 0.5rem;
		margin-left: 0.5rem;
		margin-right: 0.5rem;
		padding: 1rem;
		border-radius: 10px;
		font-size: 0.60869rem;
		font-weight: 600;
		
}
	.shiyong_detail{
		font-size: 0.5652rem;
		color: #868E91;
		font-weight: 400;
		padding-top: 0.3rem;
	}
	.con{
		margin-top: 1.1rem;
		padding-bottom: 1rem;
	}
	
	.con>div{
		padding-bottom: 0.3rem;
	}
	.con span{
		color: #868E91;
		font-weight: 400;
	}
	.con>div>img{
	 width: 0.7608rem;
	 height: 0.7608rem;
	 padding-left: 0.3rem;
	}
	.btn{
		width: 100%;
		justify-content: space-around;
	}
	.btn>div{
		width: 6.4347rem;
		height: 1.8478rem;
		border: 1px solid;
		border-radius: 10px;
		text-align: center;
		line-height: 1.8478rem;
		color: white;
		font-size: 0.65217rem;
		margin-top: 3rem;
	}
	.btn>div:nth-child(1){
		background: white;
		border: 1px solid #007AFF;
		color: #007AFF;
	}
	.btn>div:nth-child(2){
		background: #007AFF;
		border: 1px solid #007AFF ;
		color: white;
	}
	.active_detail{
		background: white;
	margin-bottom: 0.5rem;
		margin-left: 0.5rem;
		margin-right: 0.5rem;
		padding: 1rem;
		border-radius: 10px;
		font-size: 0.60869rem;
		font-weight: 600;
	}
	.active_detail span{
		color: #868E91;
		font-size: 0.565217rem;
	}
	.active_detail>div{
		padding-bottom: 0.5rem;
	}
	.fen{
		width: 100%;
		height: 2rem;
		justify-content: center;
		align-items: center;
	}
	.fen>img{
		width: 8.8748rem;
		
		
	}
</style>